#include <cstdio>

typedef long long ll;
constexpr int N = 2005, mod = 1e9 + 7;
int n, k, a[N];
ll C[N];

inline ll qpow(ll base, int exp) {
  ll res = 1;
  while (exp) {
    if (exp & 1) res = res * base % mod;
    base = base * base % mod;
    exp >>= 1;
  }
  return res;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("CF223C Partial Sums.in", "r", stdin);
  freopen("CF223C Partial Sums.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  C[0] = 1;
  for (int i = 1; i <= n; ++i) {
    C[i] = C[i - 1] * qpow(i, mod - 2) % mod * (i + k - 1) % mod;
  }
  for (int i = 1; i <= n; ++i) {
    ll tmp = 0;
    for (int j = 1; j <= i; ++j) {
      tmp = (tmp + (a[j] * C[i - j]) % mod) % mod;
    }
    printf("%lld ", tmp);
  }
  return 0;
}